#!/bin/bash

# sudo apt install gcc-mipsel-linux-gnu
# sudo apt install gcc-arm-linux-gnueabihf

JOBS=8
mkdir -p ./build-output

export CROSS_COMPILE=mipsel-linux-gnu-
make O=build-hatlab_gateboard-one hatlab_gateboard_one_defconfig
cp ./mt7621_stage_sram.blob ./build-hatlab_gateboard-one/mt7621_stage_sram.bin
make O=build-hatlab_gateboard-one -j${JOBS}
cp build-hatlab_gateboard-one/u-boot-mt7621.bin ./build-output/hatlab_gateboard_one_bios.bin

export CROSS_COMPILE=arm-linux-gnueabihf-
make O=build-hatlab_generic-v3s hatlab_generic_v3s_defconfig
make O=build-hatlab_generic-v3s -j${JOBS}
cp build-hatlab_generic-v3s/u-boot-sunxi-with-spl.bin ./build-output/hatlab_generic_v3s.bin
